package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class UnsignedNumericLiteral implements UnsignedLiteral {

    private int beginIndex;
    private int endIndex;
    private UnsignedInteger unsignedInteger1;
    private UnsignedInteger unsignedInteger2;
    private SignedInteger exponent;

    public UnsignedNumericLiteral(int beginIndex,
                                  UnsignedInteger unsignedInteger1,
                                  UnsignedInteger unsignedInteger2,
                                  SignedInteger exponent) {
        this.beginIndex = beginIndex;
        if (exponent == null) {
            if (unsignedInteger2 == null) {
                this.endIndex = unsignedInteger1.getEndIndex();
            } else {
                this.endIndex = unsignedInteger2.getEndIndex();
            }
        } else {
            this.endIndex = exponent.getEndIndex();
        }
        this.unsignedInteger1 = unsignedInteger1;
        this.unsignedInteger2 = unsignedInteger2;
        this.exponent = exponent;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public UnsignedInteger getUnsignedInteger1() {
        return unsignedInteger1;
    }

    public UnsignedInteger getUnsignedInteger2() {
        return unsignedInteger2;
    }

    public SignedInteger getExponent() {
        return exponent;
    }

}
